home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / dbpictxt.dxr / 00019_Button Code.ls < prev    next >
Encoding:
Text File  |  2000-01-27  |  2.1 KB  |  53 lines

  1. global gDBPicttextVarList
  2.  
  3. on InitButtons EnableScroll
  4.   MyObj = getaProp(gDBPicttextVarList, GetObjProp())
  5.   SaveObj = GetSaveObj(MyObj)
  6.   ButtonList = GetButtonList(MyObj)
  7.   SpList = GetSpriteList(MyObj)
  8.   cbs = getaProp(SpList, #closeBox)
  9.   mmbs = getaProp(SpList, #MaxMinBox)
  10.   CopyBS = getaProp(SpList, #CopyButton)
  11.   PrintBS = getaProp(SpList, #PrintButton)
  12.   SaveBS = getaProp(SpList, #SaveButton)
  13.   addProp(ButtonList, cbs, new(script("close box"), "close box", "global", cbs, the loc of sprite cbs))
  14.   addProp(ButtonList, mmbs, new(script("max min box"), "min max", "global", mmbs, the loc of sprite mmbs))
  15.   addProp(ButtonList, CopyBS, new(script("copy icon"), "copy", "internal", CopyBS, the loc of sprite CopyBS))
  16.   addProp(ButtonList, PrintBS, new(script("print icon"), "print", "internal", PrintBS, the loc of sprite PrintBS))
  17.   addProp(ButtonList, SaveBS, new(script("save icon"), "save", "internal", SaveBS, the loc of sprite SaveBS))
  18.   b1 = 28
  19.   b2 = 29
  20.   b3 = 30
  21.   b4 = 31
  22.   addProp(ButtonList, b1, new(script("save text"), "savetext", "internal", b1, point(143, 104)))
  23.   addProp(ButtonList, b2, new(script("save picture"), "savepic", "internal", b2, point(143, 134)))
  24.   addProp(ButtonList, b3, new(script("save both"), "saveboth", "internal", b3, point(144, 170)))
  25.   addProp(ButtonList, b4, new(script("save cancel"), "savecancel", "internal", b4, point(144, 170)))
  26.   repeat with rc in ButtonList
  27.     Inscope(rc)
  28.   end repeat
  29.   disable(getaProp(ButtonList, CopyBS))
  30.   SetButtonList(MyObj, ButtonList)
  31.   EvalDisableScroll(EnableScroll)
  32.   repeat with rc in [cbs, mmbs, PrintBS, SaveBS]
  33.     set the cursor of sprite rc to GetPointingCursor(MyObj)
  34.   end repeat
  35. end
  36.  
  37. on EvalDisableScroll EnableScroll
  38.   MyObj = getaProp(gDBPicttextVarList, GetObjProp())
  39.   ButtonList = GetButtonList(MyObj)
  40.   SpList = GetSpriteList(MyObj)
  41.   vbs = getaProp(SpList, #VBed)
  42.   nas = getaProp(SpList, #NArrow)
  43.   sas = getaProp(SpList, #SArrow)
  44.   vts = getaProp(SpList, #VThumb)
  45.   repeat with rc in [vbs, nas, sas, vts]
  46.     if EnableScroll then
  47.       Inscope(getaProp(ButtonList, rc))
  48.       next repeat
  49.     end if
  50.     disable(getaProp(ButtonList, rc))
  51.   end repeat
  52. end
  53.